package com.web.java0407demo1.controller;

import com.web.java0407demo1.entity.Student;
import com.web.java0407demo1.service.StudentService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author lenovo
 * @Description
 * @Date2025/4/7 下午5:32
 */
@RestController
public class StudentController {
    @Resource
    private StudentService studentService;

    @RequestMapping("/student/{id}")
    private ResponseEntity<Student> findStudentById(@PathVariable Integer id) {
        Student stu=studentService.findStudentById(id);
        return ResponseEntity.ok(stu);
    };
}